const EventEmitter = require("events");

// nodejs基于事件启动，libv库实现单线程处理并并发请求，适合IO密集型任务
const myEvent = new EventEmitter();

myEvent.on("事件1", () => {
  console.log("事件1执行了");
});

myEvent.on("事件1", () => {
  console.log("事件1-2执行了");
});

myEvent.emit("事件1");
